<template>
  <div class="app">
    <router-view v-slot="{ Component }">
      <transition name="fade" mode="out-in">
        <component :is="Component" />
      </transition>
    </router-view>
    <nav class="tab-bar">
      <router-link to="/" class="tab-item">
        <div class="tab-icon">🏠</div>
        <div class="tab-text">首页</div>
      </router-link>
      <router-link to="/upload" class="tab-item">
        <div class="tab-icon">📷</div>
        <div class="tab-text">发布</div>
      </router-link>
      <router-link to="/profile" class="tab-item">
        <div class="tab-icon">👤</div>
        <div class="tab-text">我的</div>
      </router-link>
    </nav>
  </div>
</template>

<script>
export default {
  name: 'App'
}
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

.app {
  max-width: 768px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background-color: white;
}

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 50px;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  z-index: 100;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #666;
  text-decoration: none;
  font-size: 12px;
}

.tab-item.router-link-active {
  color: #07c160;
}

.tab-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
</style>